<html>
	<head>

		<script type="text/javascript">

		function splitUrl(url)
		{
			var urlArr = url.split(':');
			var resultArr = new Array();			
			resultArr[0] = urlArr[0];	
			urlArr[1]=urlArr[1].replace('//',"");		
			var urlArrSec = urlArr[1].split('/');			
			resultArr[1] = urlArrSec[0];
			var holder="/";
			for(var i = 1; i<urlArrSec.length;i++)
			{
				holder+=urlArrSec[i];
				if (i !== urlArrSec.length-1) {holder += "/";};
			}			
			resultArr[2]=holder;
			return resultArr;
		};

		function onClick()
		{
			  var url = "http://www.devbg.org/forum/index.php";
			  	var output = document.getElementById('output');
		        var p = document.createElement("p");
				var info = document.createTextNode(splitUrl(url));
				p.appendChild(info);
				output.appendChild(p);		     
		};
		</script>
		<title></title>
	</head>
	<body>
		
		<p>
			http://www.devbg.org/forum/index.php
		</p>
		<button onclick="onClick()" id="buttonOne">Extract</button>
		<p>
			Output
		</p>
		<div id="output"></div>
	</body>
</html>